import request from "@/utils/request";
import type { AxiosPromise } from "axios";
import type {
  UserSkinInfoVO,
  UserSkinInfoForm,
  UserSkinInfoQuery,
} from "@/api/userSkinInfo/types";

/**
 * 查询用户主页皮肤配置列表
 * @param query
 * @returns {*}
 */

export const listUserSkinInfo = (
  query?: UserSkinInfoQuery
): AxiosPromise<UserSkinInfoVO[]> => {
  return request({
    url: "/business/userSkinInfo/list",
    method: "get",
    params: query,
  });
};

/**
 * 查询用户主页皮肤配置详细
 * @param id
 */
export const getUserSkinInfo = (
  id: string | number
): AxiosPromise<UserSkinInfoVO> => {
  return request({
    url: "/business/userSkinInfo/" + id,
    method: "get",
  });
};

/**
 * 新增用户主页皮肤配置
 * @param data
 */
export const addUserSkinInfo = (data: UserSkinInfoForm) => {
  return request({
    url: "/business/userSkinInfo",
    method: "post",
    data: data,
  });
};

/**
 * 修改用户主页皮肤配置
 * @param data
 */
export const updateUserSkinInfo = (data: UserSkinInfoForm) => {
  return request({
    url: "/business/userSkinInfo",
    method: "put",
    data: data,
  });
};

/**
 * 删除用户主页皮肤配置
 * @param id
 */
export const delUserSkinInfo = (
  id: string | number | Array<string | number>
) => {
  return request({
    url: "/business/userSkinInfo/" + id,
    method: "delete",
  });
};
